using System.Runtime.InteropServices;

namespace Service
{
	public class Internet
	{
		[DllImport("wininet.dll", CharSet = CharSet.Auto)]
		private static extern bool InternetGetConnectedState(ref ConnectionInternetState lpdwFlags, int dwReserved);
		public static bool IsConnectedToInternet()
		{
			ConnectionInternetState connectionInternetState = (ConnectionInternetState)0;
			return Internet.InternetGetConnectedState(ref connectionInternetState, 0);
		}
	}
}
